﻿@using SD.Entity
@using SD.Business.Service
@using SD.Entity.Enum
@{
    UserInfo loginUser = new UserInfoService().GetUserInfo(1);
    //查询用户的菜单权限
    int actionInfoTypeEnum = (int)ActionInfoTypeEnum.MenuActionTypeEnum;
    ViewBag.MenuList = new ActionInfoService().QueryActionListByUserId(loginUser.Id, actionInfoTypeEnum);
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="wIdth=device-wIdth" />
    <meta name="description" content="alerts" />
    <meta name="viewport" content="wIdth=device-wIdth, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>@ViewBag.Title</title>

    <!--Basic Styles-->
    <link href="~/Content/Admin/Bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="#" rel="stylesheet" />
    <link href="~/Content/Admin/Bootstrap/css/font-awesome.min.css" rel="stylesheet" />
    <link href="~/Content/Admin/Bootstrap/css/weather-icons.min.css" rel="stylesheet" />

    <!--Fonts-->
    @*<link href="http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,600,700,300" rel="stylesheet" type="text/css" />*@

    <!--Beyond styles-->
    <link href="~/Content/Admin/Bootstrap/css/beyond.min.css" rel="stylesheet" />
    <link href="~/Content/Admin/Bootstrap/css/demo.min.css" rel="stylesheet" />
    <link href="~/Content/Admin/Bootstrap/css/typicons.min.css" rel="stylesheet" />
    <link href="~/Content/Admin/Bootstrap/css/animate.min.css" rel="stylesheet" />
    <link id="skin-link" href="#" rel="stylesheet" type="text/css" />

    @RenderSection("css",false)

    <!--Skin Script: Place this script in head to load scripts for skins and rtl support-->
    <script src="~/Content/Admin/Bootstrap/js/skins.min.js"></script>
</head>
<body>
    <!-- Loading Container -->
    <div class="loading-container">
        <div class="loading-progress">
            <div class="rotator">
                <div class="rotator">
                    <div class="rotator colored">
                        <div class="rotator">
                            <div class="rotator colored">
                                <div class="rotator colored"></div>
                                <div class="rotator"></div>
                            </div>
                            <div class="rotator colored"></div>
                        </div>
                        <div class="rotator"></div>
                    </div>
                    <div class="rotator"></div>
                </div>
                <div class="rotator"></div>
            </div>
            <div class="rotator"></div>
        </div>
    </div>
    <!--  /Loading Container -->

    <!-- Navbar -->
    <div class="navbar">
        <div class="navbar-inner">
            <div class="navbar-container">
                <!-- Navbar Barnd -->
                <div class="navbar-header pull-left">
                    <a href="#" class="navbar-brand">
                        <small>
                            <img src="~/Content/Admin/Bootstrap/image/logo.png" />
                        </small>
                    </a>
                </div>
                <!-- /Navbar Barnd -->
                <!-- SIdebar Collapse -->
                <div class="sidebar-collapse" id="sidebar-collapse">
                    <i class="collapse-icon fa fa-bars"></i>
                </div>
                <!-- /SIdebar Collapse -->
                <!-- Account Area and Settings --->
                <div class="navbar-header pull-right">
                    <div class="navbar-account">
                        <ul class="account-area">
                            <li>
                                <a class=" dropdown-toggle" data-toggle="dropdown" title="Help" href="#">
                                    <i class="icon fa fa-warning"></i>
                                </a>
                                <!--Notification Dropdown-->
                                <ul class="pull-right dropdown-menu dropdown-arrow dropdown-notifications">
                                    <li>
                                        <a href="#">
                                            <div class="clearfix">
                                                <div class="notification-icon">
                                                    <i class="fa fa-phone bg-themeprimary white"></i>
                                                </div>
                                                <div class="notification-body">
                                                    <span class="title">Skype meeting with Patty</span>
                                                    <span class="description">01:00 pm</span>
                                                </div>
                                                <div class="notification-extra">
                                                    <i class="fa fa-clock-o themeprimary"></i>
                                                    <span class="description">office</span>
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="clearfix">
                                                <div class="notification-icon">
                                                    <i class="fa fa-check bg-darkorange white"></i>
                                                </div>
                                                <div class="notification-body">
                                                    <span class="title">Uncharted break</span>
                                                    <span class="description">03:30 pm - 05:15 pm</span>
                                                </div>
                                                <div class="notification-extra">
                                                    <i class="fa fa-clock-o darkorange"></i>
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="clearfix">
                                                <div class="notification-icon">
                                                    <i class="fa fa-gift bg-warning white"></i>
                                                </div>
                                                <div class="notification-body">
                                                    <span class="title">Kate birthday party</span>
                                                    <span class="description">08:30 pm</span>
                                                </div>
                                                <div class="notification-extra">
                                                    <i class="fa fa-calendar warning"></i>
                                                    <i class="fa fa-clock-o warning"></i>
                                                    <span class="description">at home</span>
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <div class="clearfix">
                                                <div class="notification-icon">
                                                    <i class="fa fa-glass bg-success white"></i>
                                                </div>
                                                <div class="notification-body">
                                                    <span class="title">Dinner with friends</span>
                                                    <span class="description">10:30 pm</span>
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                    <li class="dropdown-footer ">
                                        <span>
                                            Today, March 28
                                        </span>
                                        <span class="pull-right">
                                            10°c
                                            <i class="wi wi-cloudy"></i>
                                        </span>
                                    </li>
                                </ul>
                                <!--/Notification Dropdown-->
                            </li>
                            

                            
                            
                            <!-- /Account Area -->
                            <!--Note: notice that setting div must start right after account area list.
                            no space must be between these elements-->
                            <!-- Settings -->
                        </ul><div class="setting">
                            <a Id="btn-setting" title="Setting" href="#">
                                <i class="icon glyphicon glyphicon-cog"></i>
                            </a>
                        </div><div class="setting-container">
                            <label>
                                <input type="checkbox" Id="checkbox_fixednavbar" />
                                <span class="text">Fixed Navbar</span>
                            </label>
                            <label>
                                <input type="checkbox" Id="checkbox_fixedsIdebar" />
                                <span class="text">Fixed SIdeBar</span>
                            </label>
                            <label>
                                <input type="checkbox" Id="checkbox_fixedbreadcrumbs" />
                                <span class="text">Fixed BreadCrumbs</span>
                            </label>
                            <label>
                                <input type="checkbox" Id="checkbox_fixedheader" />
                                <span class="text">Fixed Header</span>
                            </label>
                        </div>
                        <!-- Settings -->
                    </div>
                </div>
                <!-- /Account Area and Settings -->
            </div>
        </div>
    </div>
    <!-- /Navbar -->

    <!-- Main Container -->
    <div class="main-container container-fluid">
        <!-- Page Container -->
        <div class="page-container">
            <!-- Page Sidebar -->
            <div class="page-sidebar" id="sidebar">

                <!-- SIdebar Menu -->
                <ul class="nav sidebar-menu">
                    @{
                        List<ActionInfo> menuList = ViewBag.MenuList;
                        foreach (var item in menuList)
                        {
                            if(item.Layer==1)
                            {
                                int id = item.Id; //记录出当前1级菜单的Id
                                <li class="mainmenu" data="@item.Id" >
                                    <a href="#" class="menu-dropdown">
                                        <i class="menu-icon glyphicon glyphicon-home"></i>
                                        <span class="menu-text"> @item.ActionInfoName </span>
                                        <i class="menu-expand"></i>
                                    </a>
                                
                                    <ul class="submenu">
                                        @for (int i = 0; i < menuList.Count;i++ )
                                        {
                                            if (menuList[i].Layer == 2 && menuList[i].ParentId == id)
                                            {
                                                <li>
                                                    <a href="@Url.Action(menuList[i].ActionMethodName,menuList[i].ControllerName)">
                                                        <span class="menu-text">@menuList[i].ActionInfoName</span>
                                                    </a>
                                                </li>
                                            }
                                        }
                                    </ul>
                                </li>
                            }
                        }
                    }
                </ul>
                <!-- /SIdebar Menu -->

            </div>
            <!-- /Page SIdebar -->

            <!-- Page Content -->
            <div class="page-content">
                
                <!-- 页头 -->
                <div class="page-header position-relative">
                    <div class="header-title">
                        <h1>
                            @ViewBag.ParentMenu
                            <small>
                                <i class="fa fa-angle-right"></i>
                                @ViewBag.ChildMenu
                            </small>
                        </h1>
                    </div>
                    <!--Header Buttons-->
                    <div class="header-buttons">
                        <a class="sIdebar-toggler" href="#">
                            <i class="fa fa-arrows-h"></i>
                        </a>
                        <a class="refresh" id="refresh-toggler" href="#" >
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                        <a class="fullscreen" id="fullscreen-toggler" href="#">
                            <i class="glyphicon glyphicon-fullscreen"></i>
                        </a>
                    </div>
                    <!--Header Buttons End-->
                </div>
                <!-- /页头 -->

                <!-- 页面主体 -->
                <div class="page-body">
                    <div class="row">
                        <div class="col-lg-12 col-sm-12 col-xs-12">
                            @RenderBody()
                        </div>
                    </div>

                </div>
                <!-- /页面主体 -->
            </div>
            <!-- /Page Content -->
        </div>
        <!-- /Page Container -->
        <!-- Main Container -->

    </div>

    
</body>
    <!--Basic Scripts-->

    <script src="~/Content/Admin/Bootstrap/js/jquery-2.0.3.min.js"></script>
    <script src="~/Content/Admin/Bootstrap/js/bootstrap.min.js"></script>

    <!--Beyond Scripts-->
    <script src="~/Content/Admin/Bootstrap/js/beyond.min.js"></script>

    <!--Page Related Scripts-->
    <script src="~/Content/Admin/Bootstrap/js/toastr/toastr.js"></script>
    @RenderSection("script",false)
</html>
